package game;

/**
 * @Author: liwan
 * @Description:
 * @Date: create in 2021/9/2 20:53:55
 */
public class HeroBule extends Thread{
    private int x;
    private int y;
    private int w;
    private int h;
    private GamePanel gamePanel;
    public HeroBule(GamePanel panel, int w, int h) {
        this.gamePanel = panel;
        this.x = (int)(60 + w * 1.5);
        this.y = 90;
        this.w = 500;
        this.h = h / 3;
    }

    @Override
    public void run() {
        while (true){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            this.w += 10;
            this.w = w > 500 ? 500 : w;
            gamePanel.repaint();
        }
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getW() {
        return w;
    }

    public void setW(int w) {
        this.w = w;
    }

    public int getH() {
        return h;
    }

    public void setH(int h) {
        this.h = h;
    }
}
